package exercise;
import java.util.*; 
public class TestAdd {
	public static void main(String[] args) {
		Mathine m1=new Mathine();
	
		Test1 t1=new Test1();
		t1.show();
		Test2 t2=new Test2();
		t2.show();
		Test3 t3=new Test3();
		t3.show();
		Test4 t4=new Test4();
		t4.show();
		m1.operatea(t1);
	}
 
	 
 }
class Integer{
	 int a;
	 int b;
	 int c;
	 public void show(){
		 System.out.println(this.a+" "+this.b+" "+this.c);
	 }
}
interface Adda{
	public void adda(int a);
}
interface Addb {
	public void addb(int b);
}
interface Addc{
	public void addc(int c);
}
class Test1 extends Integer implements Adda{

	@Override
	public void adda(int a) {
		this.a+=a;
     		
	}
	
}
class Test2 extends Integer implements Addb{

	@Override
	public void addb(int b) {

		this.b+=b;
	}
	
}
class Test3 extends Integer implements Addc{

	@Override
	public void addc(int b) {

		this.c+=c;
	}
	
}
class Test4 extends Integer implements Adda,Addb,Addc{

	@Override
	public void adda(int a) {

		this.a+=a;
	}

	@Override
	public void addc(int c) {

		this.b+=b;
	}

	@Override
	public void addb(int b) {

		this.c+=c;
	}

	
}
class Mathine{
	public void operatea(Test1 t1){
		t1.adda(t1.a);
	}
	public void operate (Test2 t2){
		t2.addb(t2.b);
	}
	public void operate (Test3 t3){
		t3.addc(t3.c);
		
	}
	public void operate (Test4 t4){
		t4.adda(t4.a);
		t4.addb(t4.b);
		t4.addc(t4.c);
	}
}